<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<form id="form-editar-aluno" action="adicionar-aluno" method="POST" modelAttribute="aluno" class="form-horizontal">
	<input type="hidden" name="id" value="${aluno.id}" />
	<fieldset>
   		<legend><h3>Aluno <small> editar</small></h3></legend>
   		<div class="control-group">
    		<label class="control-label">Nome: </label>
    		<label class="control-label">${aluno.nome}: </label>
    	</div>
    	
    	<div class="control-group">	
    		<label class="control-label">Novo nome: </label>
    		<div class="controls">
    			<input name="nome" class="input-large" type = "text" />
    		</div>
   		</div>
   		
   	</fieldset>
</form>

<div class="control-group form-horizontal">
	<div class="controls">
		<button id="salvar" class="btn btn-success">Salvar</button>
		<a href="/web/listar-alunos"><button class="btn">Cancelar</button></a>
		<a href="/web/excluir-aluno?id=${aluno.id}"> <button id="excluir" class="btn btn-success">Excluir</button></a>
		<c:if test="${not empty param.enableRemove}">
			<button id="excluir" class="btn btn-danger">Excluir</button>
		</c:if>
	</div>
</div>

<script>

$(document).ready(function () {
 	$("#salvar").click(function () { $("#form-editar-aluno").submit(); });
});
</script>
